#ifndef CALCULATOR_H
#define CALCULATOR_H

#include <QtGui/QWidget>
#include <QLineEdit>
#include <QHBoxLayout>
#include <QPushButton>

//#include "ui_calculator.h"

class calculator : public QWidget
{
	Q_OBJECT

public:
	calculator(QWidget *parent = 0, Qt::WFlags flags = 0);
	~calculator();

private:
//	Ui::calculatorClass ui;

private:
	QLineEdit *output;

private:
	QHBoxLayout *outputLayout;
	QVBoxLayout *layout;
	QHBoxLayout *calLayout;
	QWidget *calWidget;
	QVBoxLayout *operationLayout;
	QHBoxLayout *editLayout;

	QGridLayout *numberLayout;
	//QPushButton *oneButton;
	//QPushButton *twoButton;
	//QPushButton *threeButton;
	//QPushButton *fourButton;
	//QPushButton *fiveButton;
	//QPushButton *sixButton;
	//QPushButton *sevenButton;
	//QPushButton *eightButton;
	//QPushButton *nineButton;
	//QPushButton *dotButton;
	//QPushButton *zeroButton;
	//QPushButton *equalButton;

	QPushButton *plusButton;
	QPushButton *minusButton;
	QPushButton *multiplyButton;
	QPushButton *divideButton;

	private slots:
		void add();
		void multiply();
		void minus();
		void divide();
		void getValue();


		void onePushed();
		void twoPushed();
		void threePushed();
		void fourPushed();
		void fivePushed();
		void sixPushed();
		void sevenPushed();
		void eightPushed();
		void ninePushed();
		void zeroPushed();
		void dotPushed();

		void clearNumber();
		void clearAll();

private:
	double ans;
	double number;
	QString prevOperation;
	int dotPushedFlag;
	int dicemalCount;

private:
	void displayValue(float value);

};

#endif // CALCULATOR_H
